class Person():
    def __init__(self,name):
        self.name = name
    def __funa(self):
        print("hello world")

    def funb(self):
        print("hello python")
        if self.name == "root":
            self.__funa()

# p = Person("root")
# # p.__funa()  # 报错
# p.funb()
# 1.私有方法只能在类里面访问不能在类外面访问
# 2.通过定义私有方法添加访问条件限制
p = Person("admin")
# p.__funa()  # 报错
p.funb()